<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组排重</title>
</head>
<body>
    <script>
        function paiChong(array){

            for(var i = array.length - 1; i >= 0 ;i--){

                for(var j = i - 1; j>= 0; j--){
                    if(array[i] ==9+ array[j]){
                        // 就删除重复的元素
                        array.splice(j,1)
                        // i--;
                        break;
                    }
                }
            }
            return array;
        }

        var arr =[1,2,3,4,5,1,2,3,4,5,6,8];
        var res = paiChong(arr);
        console.log(res);
    </script>
</body>
</html>